import { createRouter, createWebHistory } from 'vue-router'

import Home from '@/views/Home.vue'
import ImageGallery from '@/views/ImageGallery.vue'

const routes = [
    {
        path: '/',
        redirect: '/home'
    },
    {
        // 当 /user/:id/profile 匹配成功
        // UserProfile 将被渲染到 User 的 <router-view> 内部
        path: '/home',
        component: Home,
    },
    {
        // 当 /user/:id/posts 匹配成功
        // UserPosts 将被渲染到 User 的 <router-view> 内部
        path: '/imageGallery',
        component: ImageGallery,
    },
]

const router = createRouter({
    // history: createWebHashHistory(),
    history: createWebHistory(),
    routes,
})

export default router;